﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Globalization;

namespace Presentation.Controls
{
    public partial class ajaxcalendar : System.Web.UI.UserControl
    {
        string _ValidationGroup;

        protected void Page_Load(object sender, EventArgs e)
        {
            RequiredFieldValidator.ValidationGroup = _ValidationGroup;
            RegularExpressionValidator.ValidationGroup = _ValidationGroup;
        }

        public string ValidationGroup
        {
            get
            {
                return (_ValidationGroup);
            }
            set
            {
                _ValidationGroup = value;
            }
        }


        public DateTime Date { 
            get
            {
                return (DateTime.Parse(TextBox.Text, new CultureInfo("es-AR", false)));
            }
            set
            {
                TextBox.Text = value.ToString(CalendarExtender.Format);
            }
        }

        public String Title
        {
            get
            {
                return (Label.Text);
            }
            set
            {
                Label.Text = value;
            }
        }
    }
}